package com.example.testservice;

import android.app.IntentService;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

public class MyIntentService extends IntentService{

	public MyIntentService() {
		super("MyIntentService");
		Log.i("gjf", "MyIntentService++++++++++");	
	}
	
	@Override
	protected void onHandleIntent(Intent arg0) {
		Log.i("gjf", "onHandleIntent++++++++++");
		long endTime = System.currentTimeMillis() + 10 * 1000;
		while(System.currentTimeMillis() < endTime){
			synchronized (this) {
				try {
					wait(endTime - System.currentTimeMillis());
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}		
	}

}
